<?php
/**
 * Description of WacStockGoodsStatementType
 *    stock goods statement type
 *
 * @author ben
 */
class WacStockGoodsStatementType
{
    public static $params = array(
        "in" => array("name"=>"in", "code"=>"1", "label"=>"进仓"),
        "out" => array("name"=>"out", "code"=>"2", "label"=>"出仓"),
    );

    /*
     * get attribute
     */
    public static function getAttribute($key, $attribute)
    {
        return self::$params[$key][$attribute];
    }

    /*
     * @return attribute by code
     */
    public static function getAttributeByCode($code, $attribute)
    {
        $row = self::getRowByCode($code);
        if($row != false){
            return $row[$attribute];
        }
    }

    /*
     *  getRowById
     * @return false or found array
     */
    public static function getRowByCode($code)
    {
        $result = false;
        foreach(self::$params as $param)
        {
            if($param['code']==$code)
            {
                $result = $param;
                break;
            }
        }
        return $result;
    }

    
}
